package com.ea.common.enums;

/**
 * @author NAME-L
 * @Description TODO
 * @className OrderStatus
 * @date 2022-12-15 00:14:57
 */
public enum OrderStatusEnums {

    BE_CONFIRM(0, "待确认"),

    CONFIRM(1, "已确认"),

    CANCLE(2, "已取消"),

    COMPLETED(3, "已完成"),

    EXCEPTION(4, "异常件"),
    ;
    private Integer code;

    private String msg;

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    OrderStatusEnums(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String getOrderStatus(Integer code) {
        for (OrderStatusEnums enums : values()) {
            if (enums.getCode().equals(code)) {
                return enums.getMsg();
            }
        }
        return null;
    }
}
